<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script language="Javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.tablesorter.js"></script>
<script type="text/javascript" src="js/paging.js"></script>

<script language="JavaScript">
	$(document).ready(function() {
		$("#allsts").change(function() {
			var isChecked = $('.selsts').attr('checked') ? true : false;
			if (isChecked == false) {
				$(".selsts").attr('checked', true);
			} else {
				$(".selsts").attr('checked', false);
			}

		});

		$('#search').keyup(function() {
			searchTable($(this).val());
		});

		$("#example").tablesorter({
			// pass the headers argument and assing a object 
			headers : {
				// assign the secound column (we start counting zero) 
				0 : {
					// disable it by setting the property sorter to false 
					sorter : false
				},
				// assign the third column (we start counting zero) 
				5 : {
					// disable it by setting the property sorter to false 
					sorter : false
				},
				6 : {
					// disable it by setting the property sorter to false 
					sorter : false
				},
				3 : {
					// disable it by setting the property sorter to false 
					sorter : false
				},
				4 : {
					// disable it by setting the property sorter to false 
					sorter : false
				}
			}
		});
	});

	function searchTable(inputVal) {
		var table = $('#example');
		table.find('tr').each(function(index, row) {
			var allCells = $(row).find('td');
			if (allCells.length > 0) {
				var found = false;
				allCells.each(function(index, td) {
					var regExp = new RegExp(inputVal, 'i');
					if (regExp.test($(td).text())) {
						found = true;
						return false;
					}
				});
				if (found == true)
					$(row).show();
				else
					$(row).hide();
			}
		});
	}
</script>

<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
	<div align="left">
		<s:actionerror />
	</div>
	<form name="table" action="editfinancials.action?type=staff&edit=add" method="post">
	<s:iterator value="list">
		<table id="example" class="tablesorter" width="100%">
			<tr>
				<td>Staff Id</td>
				<td><s:property value="roll_number" />
				<input type="hidden" name="staff_id" value='<s:property value="staff_id"/>' />
				</td>
			</tr>
			<tr>
				<td>Salary</td>
				<td><input type="text" name="salary_amount" required="required"/></td>
			</tr>
			<tr>
				<td>Payment Made</td>
				<td><select name="payment_made">
						<option value="2">Yes</option>
						<option value="1">Pending</option>
						<option value="0">No</option>
				</select></td>
			</tr>
			<tr>
				<td>Year</td>
				<td><input type="number" name="year" required min="2011"/></td>
			</tr>
			<tr>
				<td>Month</td>
				<td><input type="number" name="month" required min="1" max="12"/></td>
			</tr>
			<tr>
				<td>Account Number</td>
				<td><input type="text" name="acc_no"  value='<s:property value="acc_no"/>' required/> Existing acc_no:<s:property value="acc_no"/></td>
			</tr>
			<tr>
				<td>Transaction Id</td>
				<td><input type="text" name="transaction_id" required/></td>
			</tr>
			<tr>
			<td colspan="2"><input type="submit" value="Add Entry"/></td>
			</tr>
		</table>
</s:iterator>
	</form>
	
	<!-- <s:iterator value="list">
		<form id="viewall" action="viewfinancials.action" method="post">
			<input type="hidden" name="type" value="staff" /> <input
				type="hidden" name="edit" value="viewall" /> <input type="hidden"
				name="staff_id" value='<s:property value="staff_id"/>' />
		</form>

		<form id="edit" action="editfinancials.action" method="post">
			<input type="hidden" name="type" value="staff" /> <input
				type="hidden" name="edit" value="edit" /> <input type="hidden"
				name="staff_id" value='<s:property value="staff_id"/>' />
		</form>

		<form id="delete" action="editfinancials.action" method="post">
			<input type="hidden" name="type" value="staff" /> <input
				type="hidden" name="edit" value="delete" /> <input type="hidden"
				name="staff_id" value='<s:property value="staff_id"/>' />
		</form>
	</s:iterator>
-->
</body>
</html>